﻿namespace Sustainalytics.Portfolios.BL
{
    public class PortfolioImportResult
    {
        public int NumberOfCorrectMatches { get; set; }

        public int NumberOfUnmatchedRows { get; set; }

        public byte[] FileContent { get; set; }

        public string MatchingSummary
        {
            get
            {
                if (NumberOfCorrectMatches == 0 && NumberOfUnmatchedRows > 0)
                {
                    return "No matches found for the uploaded securities.";
                }
                if (NumberOfCorrectMatches > 0 && NumberOfUnmatchedRows > 0)
                {
                    return string.Format("{0} securities successfully matched <br /> {1} securities not matched",
                        NumberOfCorrectMatches, NumberOfUnmatchedRows);
                }
                if (NumberOfCorrectMatches > 0 && NumberOfUnmatchedRows == 0)
                {
                    return "All securities successfully matched";
                }
                return string.Empty;
            }
        }


    }
}